import request from "@/utils/request";
import { IQueryParams, IOrderNo, transferParams, IRefundParams } from "./data";

// 列表
export async function queryList(data: IQueryParams): Promise<any> {
	return request({
		url: "/nutrition/admin/nutOnlineOrder/pageList",
		method: "post",
		data,
	});
}
// 导出
export async function exportList(data: IQueryParams): Promise<any> {
	return request({
		url: "/nutrition/admin/nutOnlineOrder/downloadExcel",
		method: "post",
		data,
	});
}

// 获取就诊人信息
export async function getPatientInfo(params: IOrderNo): Promise<any> {
	return request({
		url: "/nutrition/admin/nutOnlineOrder/patientDetail",
		method: "get",
		params,
	});
}

// 获取营养方案
export async function getNutritionPlan(params: IOrderNo): Promise<any> {
	return request({
		url: "/nutrition/admin/nutScheme/schemeDetail",
		method: "get",
		params,
	});
}

// 获取营养师列表
export async function getNutritionistList(params: IOrderNo): Promise<any> {
	return request({
		url: "/nutrition/admin/nutritionist/nutritionistNamePage",
		method: "get",
		params,
	});
}

// 营养师转出
export async function transferNutritionist(data: transferParams): Promise<any> {
	return request({
		url: "/nutrition/admin/nutOnlineOrder/nutritionistTransferOut",
		method: "get",
		data,
	});
}

// 获取医师列表
export async function getDoctorList(params: IOrderNo): Promise<any> {
	return request({
		url: "/nutrition/admin/doctor/doctorNamePage",
		method: "get",
		params,
	});
}

// 医师转出
export async function transferDoctor(data: transferParams): Promise<any> {
	return request({
		url: "/nutrition/admin/nutOnlineOrder/doctorTransferOut",
		method: "get",
		data,
	});
}

// 退款
export async function teletextRefund(data: IRefundParams): Promise<any> {
	return request({
		url: "/nutrition/admin/pay/onlineOrderRefund",
		method: "post",
		data,
	});
}
